<?php

use Core\API_Controller;
use Models\Cashier;

class LogoutController extends API_Controller
{
	public function index()
	{
		$cashier = (new Cashier)->find($this->session->cashier['id']);
		if ($cashier) {
			$cashier->logout();
		}
		$this->session->cashier = null;

		return $this->success();
	}
}
